Setting and Removing Breakpoints

Breakpoints are useful when you have a general idea of where a bug occurs in a program. WinDbg runs until it reaches a breakpoint, then stops. You can then step to the next line of code or trace through a function until you find the problem.

{bmc bm4.MRB}        To set a breakpoint in the GENERIC program

  1.  Move the insertion point to the first line of the About function in the source code.

  2.  From the Debug menu, choose Breakpoints. The Breakpoints dialog box appears.

  3.  From the Break list, select at Location.

  4.  Choose Add.

  5.  Choose OK.

  6.  Choose Go from the Run menu. The GENERIC program begins to run.

  7.  While the program is running, choose About Generic from its Help menu. The program stops and the breakpoint line is highlighted in the source window.

 

{bmc bm4.MRB}        To remove a breakpoint

  1.  From the Debug menu, choose Breakpoints. The Breakpoints dialog box appears.

  2.  Select the breakpoint to remove from the Breakpoints list.

  3.  Choose Delete.

  4.  Choose OK.

 

The Breakpoints dialog box offers a variety of options for setting breakpoints. You can set breakpoints based on Windows messages, memory location, and the values in an expression. See WINDBG.HLP for details.